#include <stdio.h>
#include <stdlib.h>

#include "SDL.h"

#define TICK_INTERVAL    1000

static Uint32 next_time;

Uint32 time_left(void)
{
    Uint32 now;

    now = SDL_GetTicks();
    if(next_time <= now)
        return 0;
    else
        return next_time - now;
}


int main(int argc, char *argv[])
{
    /* main game loop */

    next_time = SDL_GetTicks() + TICK_INTERVAL;
    int game_running = 1;
    while ( game_running ) {
        printf("tick %d\n", next_time);
//        update_game_state();
        SDL_Delay(time_left());
        next_time += TICK_INTERVAL;
    }
}
